import { PureComponent } from 'react'

// 定义组件: 给一些需要特殊数据的组件, 注入props
export default function enhancedProps(WrappedComponent) {
  return class extends PureComponent {
    constructor(props) {
      super(props)
      this.state = {
        info: {
          name: "enhancedProps-name",
          level: 89
        }
      }
    }
    
    render() {
      return <WrappedComponent  {...this.props} {...this.state.info}/>
    }
  }
}